package com.pjnkj.thunder.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author pjnkj
 * @since 2022-03-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("invite")
@ApiModel(value = "Invite对象", description = "")
public class Invite extends Model<Invite> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "邀请用户")
    @TableField("userid")
    private Integer userid;

    @ApiModelProperty(value = "邀请用户")
    @TableField(exist = false)
    private User user;

    @ApiModelProperty(value = "邀请id")
    @TableField("inviteid")
    private Integer inviteid;

    @ApiModelProperty(value = "邀请人")
    @TableField(exist = false)
    private User invite;

    @ApiModelProperty(value = "增加时间")
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "lastModifiedTime", fill = FieldFill.INSERT_UPDATE)
    private Date lastModifiedTime;

    @ApiModelProperty(value = "被邀请id")
    @TableField("parentid")
    private Integer parentid;

    @ApiModelProperty(value = "被邀请人")
    @TableField(exist = false)
    private User parent;

    @ApiModelProperty(value = "邀请状态1成功0邀请中2失败")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
